package cn.dglydrpy.study.ssm.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.dglydrpy.study.ssm.dao.entity.Account;
import cn.dglydrpy.study.ssm.service.IAccountService;

@Controller
public class HelloController {
	
	/**
     * Spring容器和SpringMVC容器是有层次的（父子容器）
     * Spring容器：service对象+dao对象
     * SpringMVC容器：controller对象，，，，可以引用到Spring容器中的对象
     */
	 @Autowired
	 private IAccountService accountService;
	 
	@RequestMapping("/queryAll")
	@ResponseBody
	public List<Account> queryAll() throws Exception {
		return accountService.queryAccountList();
	}
	
}
